package com.efounder.view;

import android.view.View;

import com.efounder.mobilemanager.R;
import com.efounder.utils.ResStringUtil;
import com.qmuiteam.qmui.widget.QMUIEmptyView;

/**
 * 使用 QMUIEmptyView实现的空view
 * Created by YQS.
 * Date: 2019/7/27
 * Time: 14:27
 */
public class CommonQMEmptyView implements IEmptyView {

    private QMUIEmptyView qmuiEmptyView;

    @Override
    public void show(boolean loading) {
        qmuiEmptyView.show(loading);
    }

    @Override
    public void show(String titleText, String detailText) {
        qmuiEmptyView.show(titleText, detailText);
    }

    @Override
    public void show(boolean loading, String titleText, String detailText, String buttonText, View.OnClickListener onButtonClickListener) {
        qmuiEmptyView.show(loading, titleText, detailText, buttonText, onButtonClickListener);
    }

    @Override
    public QMUIEmptyView getQMUIEmptyView() {
        return qmuiEmptyView;
    }

    @Override
    public void setQMUIEmptyView(QMUIEmptyView qmuiEmptyView) {
        this.qmuiEmptyView = qmuiEmptyView;
    }

    @Override
    public void show() {
        qmuiEmptyView.show();
    }

    @Override
    public void showNetError() {
        qmuiEmptyView.show(ResStringUtil.getString(R.string.common_text_http_request_fail_abnormal), null);
    }

    @Override
    public void showNoData() {
        qmuiEmptyView.show(ResStringUtil.getString(R.string.common_text_no_data), null);

    }

    @Override
    public void hide() {
        qmuiEmptyView.hide();
    }
}
